<%@ page import="com.zsr.pojo.Person" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: zsr
  Date: 2021/3/20
  Time: 8:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    Person person=new Person();
    person.setName("周某");
    person.setAge(18);
    person.setPhones(new String[]{"18164646444","14777747777","18679779777"});

    List<String> cities=new ArrayList<String>();
    cities.add("上海");
    cities.add("北京");
    cities.add("深圳");
    person.setCities(cities);

    Map<String,Object> map =new HashMap<>();
    map.put("key1","value1");
    map.put("key2","value2");
    map.put("key3","value3");
    map.put("key4","value4");
    person.setMap(map);

    pageContext.setAttribute("p",person);

%>
输出Person  ${p}
输出Person的name  ${p.name}
输出Person的phones  ${ p.phones[0]}
输出Person的cities  ${ p.cities}
输出Person的map  ${ p.map.key1}

</body>
</html>
